package simonxianyu.boot.mybatis;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import simonxianyu.boot.mybatis.interceptor.PaginationResultSetInterceptor;
import simonxianyu.boot.mybatis.interceptor.PaginationStatementInterceptor;

/**
 * MyBatis自动配置模块，实现注册分页插件
 */
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true)
public class MyBatisExtConfiguration2 {
  private Logger log = LoggerFactory.getLogger(MyBatisExtConfiguration2.class);

  @Bean
  public PaginationResultSetInterceptor resultSetInterceptor() {
    return new PaginationResultSetInterceptor();
  }

  @Bean
  public PaginationStatementInterceptor statementInterceptor() {
    return new PaginationStatementInterceptor();
  }

}
